<html>

<head>
    <title>
        闲聊中···
    </title>

    <link href="http://fonts.googleapis.com/css?family=Lato:100,300,400,700" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/bootstrap.min.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/font-awesome.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/se7en-font.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/isotope.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/jquery.fancybox.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/fullcalendar.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/wizard.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/select2.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/morris.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/datatables.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/datepicker.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/timepicker.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/colorpicker.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/bootstrap-switch.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/daterange-picker.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/typeahead.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/summernote.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/pygments.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/style.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/static/stylesheets/color/green.css" media="all" rel="alternate stylesheet" title="green-theme" type="text/css" />
    <link href="/static/stylesheets/color/orange.css" media="all" rel="alternate stylesheet" title="orange-theme" type="text/css" />
    <link href="/static/stylesheets/color/magenta.css" media="all" rel="alternate stylesheet" title="magenta-theme" type="text/css" />
    <link href="/static/stylesheets/color/gray.css" media="all" rel="alternate stylesheet" title="gray-theme" type="text/css" />

    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js" type="text/javascript"></script>
    <script src="/static/javascripts/bootstrap.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/raphael.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/selectivizr-min.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.mousewheel.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.vmap.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.vmap.sampledata.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.vmap.world.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.bootstrap.wizard.js" type="text/javascript"></script>
    <script src="/static/javascripts/fullcalendar.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/gcal.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.dataTables.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/datatable-editable.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.easy-pie-chart.js" type="text/javascript"></script>
    <script src="/static/javascripts/excanvas.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.isotope.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/isotope_extras.js" type="text/javascript"></script>
    <script src="/static/javascripts/modernizr.custom.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.fancybox.pack.js" type="text/javascript"></script>
    <script src="/static/javascripts/select2.js" type="text/javascript"></script>
    <script src="/static/javascripts/styleswitcher.js" type="text/javascript"></script>
    <script src="/static/javascripts/wysiwyg.js" type="text/javascript"></script>
    <script src="/static/javascripts/summernote.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.inputmask.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.validate.js" type="text/javascript"></script>
    <script src="/static/javascripts/bootstrap-fileupload.js" type="text/javascript"></script>
    <script src="/static/javascripts/bootstrap-datepicker.js" type="text/javascript"></script>
    <script src="/static/javascripts/bootstrap-timepicker.js" type="text/javascript"></script>
    <script src="/static/javascripts/bootstrap-colorpicker.js" type="text/javascript"></script>
    <script src="/static/javascripts/bootstrap-switch.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/typeahead.js" type="text/javascript"></script>
    <script src="/static/javascripts/daterange-picker.js" type="text/javascript"></script>
    <script src="/static/javascripts/date.js" type="text/javascript"></script>
    <script src="/static/javascripts/morris.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/skycons.js" type="text/javascript"></script>
    <script src="/static/javascripts/fitvids.js" type="text/javascript"></script>
    <script src="/static/javascripts/jquery.sparkline.min.js" type="text/javascript"></script>
    <script src="/static/javascripts/main.js" type="text/javascript"></script>
    <script src="/static/javascripts/respond.js" type="text/javascript"></script>

    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
</head>

<body style="padding-top: 68px">
<div class="modal-shiftfix">

    <!-- Navigation -->
    <div class="navbar navbar-fixed-top scroll-hide" style="height: auto;">
        <div class="container-fluid top-bar">
            <div class="pull-right">
                <ul class="nav navbar-nav pull-right">
                    <li class="dropdown notifications hidden-xs">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#"><span aria-hidden="true" class="se7en-flag"></span>
                            <div class="sr-only">
                                Notifications
                            </div>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="#">
                                <div class="notifications label label-info">
                                    New
                                </div>
                                <p>
                                    New user added: Jane Smith
                                </p></a>

                            </li>
                            <li><a href="#">
                                <div class="notifications label label-info">
                                    New
                                </div>
                                <p>
                                    Sales targets available
                                </p></a>

                            </li>
                            <li><a href="#">
                                <div class="notifications label label-info">
                                    New
                                </div>
                                <p>
                                    New performance metric added
                                </p></a>

                            </li>
                            <li><a href="#">
                                <div class="notifications label label-info">
                                    New
                                </div>
                                <p>
                                    New growth data available
                                </p></a>

                            </li>
                        </ul>
                    </li>
                    <li class="dropdown messages hidden-xs">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#"><span aria-hidden="true" class="se7en-envelope"></span>
                            <div class="sr-only">
                                Messages
                            </div>
                        </a>
                        <ul class="dropdown-menu messages">
                            <li><a href="#">
                                <img width="34" height="34" src="/static/images/avatar-male2.png" />Could we meet today? I wanted...</a>
                            </li>
                            <li><a href="#">
                                <img width="34" height="34" src="/static/images/avatar-female.png" />Important data needs your analysis...</a>
                            </li>
                            <li><a href="#">
                                <img width="34" height="34" src="/static/images/avatar-male2.png" />Buy Se7en today, it's a great theme...</a>
                            </li>
                        </ul>
                    </li>
                    <li class="dropdown settings hidden-xs">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#"><span aria-hidden="true" class="se7en-gear"></span>
                            <div class="sr-only">
                                Settings
                            </div>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <a class="settings-link blue" href="javascript:chooseStyle('none', 30)"><span></span>蓝</a>
                            </li>
                            <li>
                                <a class="settings-link green" href="javascript:chooseStyle('green-theme', 30)"><span></span>绿</a>
                            </li>
                            <li>
                                <a class="settings-link orange" href="javascript:chooseStyle('orange-theme', 30)"><span></span>橙</a>
                            </li>
                            <li>
                                <a class="settings-link magenta" href="javascript:chooseStyle('magenta-theme', 30)"><span></span>品红</a>
                            </li>
                            <li>
                                <a class="settings-link gray" href="javascript:chooseStyle('gray-theme', 30)"><span></span>灰</a>
                            </li>
                        </ul>
                    </li>
                    <li class="dropdown user hidden-xs"><a data-toggle="dropdown" class="dropdown-toggle" href="#">
                        <img width="34" height="34" src="/static/images/avatar-male.jpg" />Shinveam<b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="/article/gallery">
                                <i class="icon-picture"></i>图片欣赏</a>
                            </li>
                            <li><a href="/article/chat" target="_blank">
                                <i class="icon-comments"></i>和我聊天</a>
                            </li>
                            <li><a href="/article/404">
                                <i class="icon-gear"></i>账号设置</a>
                            </li>
                            <li><a href="/article/exit">
                                <i class="icon-signout"></i>退出</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
            <button class="navbar-toggle">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="logo" href="/article/index"></a>
            <form class="navbar-form form-inline col-lg-2 hidden-xs">
                <input class="form-control" placeholder="Search" type="text">
            </form>
        </div>
    </div>

    <!-- End Navigation -->
    <div class="container-fluid main-content">
        <div class="page-title">
            <h1>
                闲聊
            </h1>
        </div>
        <div class="row">
            <!-- Conversation -->
            <div class="col-lg-12">
                <div class="widget-container scrollable chat chat-page" style="padding-left: 0px">

                    <div class="heading">
                        <i class="icon-comments"></i>Chat with <a href="#">Shinveam</a><i class="icon-cog pull-right"></i><i class="icon-smile pull-right"></i>
                    </div>
                    <div class="widget-content padded" id="div1">
                        <ul id="ul1"></ul>
                    </div>
                    <div class="post-message">
                        <form onsubmit="return false">
                            <input class="form-control" placeholder="在这输入聊天内容" type="text" id="message">
                            <input type="submit" value="发送" onclick="doSubmit()">
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    function doSubmit(){
        //移动至最底部
        var scrollHeight = $('#div1').prop("scrollHeight");
        $('#div1').animate({scrollTop:scrollHeight}, 500);

        // alert($("input[id='remember']").is(':checked'));
        // return;
        $.post("/article/chat",{
            "message":$("#message").val(),

        },function(resultData,statu){
           array1 = resultData.split("**###**");
            $("#ul1").append("<li class=\"current-user\"> <img width=\"30\" height=\"30\" src=\"/static/images/avatar-female.jpg\" />" +
                    "<div class=\"bubble\"><a class=\"user-name\" href=\"#\">Mine</a><p class=\"message\">"+array1[0]+"</p></div></li>")
            $("#ul1").append("<li><img width=\"30\" height=\"30\" src=\"/static/images/avatar-male.jpg\" /><div class=\"bubble\"><a class=\"user-name\" href=\"#\">Turing's</a><p class=\"message\">"+
            array1[1]+"</p></div></li>");
            $("#message").val("");
        })

    }

</script>
</html>